<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        canvas{
            border: 1px solid black;
        }
    </style>
</head>
<body>
    <canvas width="800" height="500"></canvas>
    <script>
        let canvas = document.querySelector('canvas');
        let ctx = canvas.getContext('2d');

        let chatPath = new Path2D();
        ctx.strokeStyle = 'skyblue';
        ctx.lineWidth = 10;
        chatPath.moveTo(200,200);
        chatPath.quadraticCurveTo(200,100,300,100);
        chatPath.lineTo(500,100);
        chatPath.quadraticCurveTo(600,100,600,200);
        chatPath.quadraticCurveTo(600,300,500,300);
        chatPath.lineTo(300,300);
        chatPath.lineTo(200,350);
        chatPath.lineTo(270,300);
        chatPath.quadraticCurveTo(200,300,200,200);

        ctx.clip(chatPath);

        let img = new Image();
        img.src = '../00-assets/imgs/s11.jpg';
        img.onload = function(){
            ctx.drawImage(img,0,0,1837,1080);
        }
        ctx.stroke(chatPath);

    </script>
</body>
</html>